package com.zxisl;

import com.zxisl.handler.MailHandler;
import com.zxisl.init.Init;
import org.apache.log4j.Logger;
import org.dom4j.DocumentException;

import java.io.File;
import java.io.IOException;
import java.util.List;

/**
 * 过滤邮箱账号密码 保存可以用imap 连接的邮箱账号密码
 * Created by ade on 2016/11/1.
 */
public class FilterMain {

    public static Logger filterMainLogger = Logger.getLogger(FilterMain.class);

    public static void main(String[] args) throws DocumentException {

        File readFile = new File(args[0]);
        File saveFile = new File(args[1]);
        try {
            MailHandler mailHandler = new MailHandler();
            List<String> subList = Init.getSubjectByXpath();
            mailHandler.saveCanConnectedMail(subList, mailHandler, readFile, saveFile);
        } catch (IOException e) {
            filterMainLogger.info(e.getMessage());
        }
    }
}
